package com.demo.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.demo.constant.Constant;
import com.demo.entity.DoctorMedicine;
import com.demo.mapper.DoctorMedicineMapper;
import com.demo.service.IDoctorMedicineService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 医嘱药物表 服务实现类
 * @author zm
 * @since 2021-03-26
 */
@Service
public class DoctorMedicineServiceImpl extends ServiceImpl<DoctorMedicineMapper, DoctorMedicine> implements IDoctorMedicineService {


    @Override
    public boolean addDoctorMedicine(List<DoctorMedicine> list) throws Exception {
        boolean flag = this.saveBatch(list);
        if (flag == false){
            throw new Exception(Constant.DB_ERROR);
        }
        return flag;
    }
}
